﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Homework3输出质数
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Write(2 + " ");
            int j = 0, k = 1;
            for (int Number = 3; Number < 100000; Number++)
            {
                double num = System.Math.Sqrt(Number);
                for (int i = 1; i < num; i++)
                {
                    if (Number % i == 0)
                    {
                        j = j + 1;
                    }
                }
                if (j == 1)
                {
                    k = k + 1;
                    if (k % 15 == 0)
                    {
                        Console.WriteLine(Number);
                    }
                    else
                    {
                        Console.Write(Number + " ");
                    }

                }
                j = 0;
            }
            Console.ReadKey();
        }
    }
}
